<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3"><a id="head" ></a>用户管理</h1>
</div>
<div class="col-sm-12" ng-controller="userViewController">
    <ng-form role="form" name="form" class="form-validation" ng-show="!CropImg.showView">
        <uib-tabset justified="true" class="tab-container">
            <uib-tab heading="基本信息">
                <div class="panel panel-default">
                    <div class="panel-heading">
                    </div>

                    <div class="panel-body">
                        <div class="col-sm-3">
                            <img ng-click="CropImg.imgCrop()" ng-if="entity.picture" ng-src="{{entity.picture}}" />
                            <img ng-click="CropImg.imgCrop()" ng-if="!entity.picture" src="img/b20.jpg" class="b b-a wrapper-xs bg-white img-responsive img-full">
                        </div>
                        <div class="col-sm-9">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">组织机构</label>
                                <div class="col-sm-9">
                                    <input type="text" ng-click="openGroupTree()" class="form-control m-b-xs" placeholder="组织机构" ng-model="group.id | sys_group_Fiter:'name'" required>
                                </div>
                            </div>
                            <div class="line line-dashed b-b line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">用户名</label>
                                <div class="col-sm-9">
                                    <input type="text" name="name" class="form-control m-b-xs" ng-disabled="type == 'update'" ui-validate-async="{unique : 'unique($value)' }" placeholder="用户名" ng-model="entity.name" required >
                                    <div class="bg-danger" ng-show="form.name.$invalid">
                                        <div ng-show="form.name.$error.unique">用户名已经存在，请重新输入。</div>
                                    </div>
                                </div>
                            </div>
                            <div class="line line-dashed b-b line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">密码</label>
                                <div class="col-sm-9">
                                    <input type="password" class="form-control m-b-xs" ng-disabled="type == 'update'" placeholder="密码" ng-model="entity.password" required >
                                </div>
                            </div>
                            <div class="line line-dashed b-b line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">确认密码</label>
                                <div class="col-sm-9">
                                    <input type="password" class="form-control m-b-xs" ng-disabled="type == 'update'" placeholder="确认密码"  ng-model="confirmPassword" name="confirmPwd" ui-validate=" '$value==entity.password' " ui-validate-watch=" 'entity.password' " required >
                                </div>
                            </div>
                            <div class="line line-dashed b-b line-lg pull-in"></div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">联系电话</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control m-b-xs" placeholder="联系电话" ng-model="entity.phone" >
                                </div>
                            </div>
                            <!--<div class="line line-dashed b-b line-lg pull-in"></div>-->
                            <!--<div class="form-group">-->
                            <!--<label class="col-sm-3 control-label">过期时间</label>-->
                            <!--<div class="col-sm-9" ng-controller="DatepickerDemoCtrl">-->
                            <!--<p class="input-group">-->
                            <!--<span class="input-group-btn">-->
                            <!--<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>-->
                            <!--</span>-->
                            <!--<input type="text" class="form-control m-b-xs" uib-datepicker-popup="yyyy-MM-dd"  placeholder="过期时间" ng-model="entity.expiredDt" is-open="status.opened" datepicker-options="dateOptions" ng-required="true" close-text="关闭" clear-text="重置" current-text="今天" />-->
                            <!--</p>-->
                            <!--</div>-->
                            <!--</div>-->
                            <div class="line line-dashed b-b line-lg pull-in" ng-show="roleGrid.getSelectedRows().length"></div>
                            <div class="form-group" ng-repeat="role in roleGrid.getSelectedRows()">
                                <label class="col-sm-3 control-label">角色</label>
                                <div class="col-sm-9">
                                    <p>{{role.name}}</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </uib-tab>
            <uib-tab heading="角色信息" select="roleGrid.resize()">
                <div class="table-responsive">
                    <div ui-grid="roleGrid.gridOptions" ui-grid-resize-columns ui-grid-selection ui-grid-pagination ui-grid-move-columns class="ag-fresh" style="min-height: 500px;"></div>
                </div>
            </uib-tab>
        </uib-tabset>
        <footer class="panel-footer  lter">
            <!-- alert -->
            <div class="m-b-md">
                <uib-alert ng-repeat="alert in Alert.alerts" type="{{alert.type}}" close="Alert.closeAlert($index)">{{alert.msg}}</uib-alert>
            </div>
            <!-- / alert -->
            <button type="submit" class="btn btn-success" ng-disabled="form.$invalid || saveBtnDisable" ng-click="save(); saveBtnDisable = true;">保存</button>
            <button type="submit" class="btn btn-success" ng-click="canle()">返回</button>
        </footer>
    </ng-form>
    <div class="col-sm-12" ng-show="CropImg.showView">
        <div ng-include="'tpl/blocks/photoCrop.html'"></div>
    </div>
</div>